﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Sinacor.Service.Infra.AuthorizationService.Service.ServiceImplementation.Translator
{
    public class PolicyTypeTranslator
    {
        public void Translate(BusinessEntity.Enum.PolicyType? from, out DataContract.Enum.PolicyType? to)
        {
            switch (from)
            {
                case BusinessEntity.Enum.PolicyType.Permissive:
                    to = DataContract.Enum.PolicyType.Permissive;
                    break;
                case BusinessEntity.Enum.PolicyType.Restrictive:
                    to = DataContract.Enum.PolicyType.Restrictive;
                    break;
                default:
                    to = null;
                    break;
            }
        }

        public void Translate(DataContract.Enum.PolicyType? from, out BusinessEntity.Enum.PolicyType? to)
        {
            switch (from)
            {
                case DataContract.Enum.PolicyType.Permissive:
                    to = BusinessEntity.Enum.PolicyType.Permissive;
                    break;
                case DataContract.Enum.PolicyType.Restrictive:
                    to = BusinessEntity.Enum.PolicyType.Restrictive;
                    break;
                default:
                    to = null;
                    break;
            }
        }
    }
}
